﻿using System.Reflection;

namespace NRemedy
{
    public class GetGenerateFieldDelegate : IGetGenerateFieldDelegate
    {
        public GenerateFieldDelegate getGenerateFieldDelegate()
        {
            return new GenerateFieldDelegate(fieldDelegate);
        }

        private bool fieldDelegate(string fieldName)
        {
            ARRegularForm arrf = new ARRegularForm();
            foreach (PropertyInfo pi in arrf.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
            {
                if (pi.Name == fieldName)
                {
                    return false;
                }
            }
            return true;

        }
    }
}
